Skip to content

chore: bump dependencies to clear npm audit - #14

Merged
kevinccbsg merged 1 commit into
mainfrom
chore/validate-dependency-updates
Sep 5, 2026
Merged

kevinccbsg merged 1 commit into
mainfrom
chore/validate-dependency-updates

Conversation

@kevinccbsg

Copy link
Copy Markdown
Member

Brings npm audit from 4 high → 0 vulnerabilities, and validates how far the remaining major bumps can safely go.

All four advisories were dev-only and never shipped — the published package's sole runtime dependency is ws. So this is CI-noise and hygiene, not a fix for anyone installing twd-relay.

How each vulnerability was cleared

Advisory Reached us via Cleared by
postcss, nanoid vite vite 8.1.3 → 8.2.2
brace-expansion vite-plugin-dts → api-extractor / @vue/language-core → minimatch lockfile refresh — no version bump needed
fast-uri vite-plugin-dts → api-extractor → tsdoc-config → ajv overrides (only option)

brace-expansion is worth a note: it was never actually stuck. Its parents already accepted the fixed 5.0.9 / 2.1.4, but the lockfile was pinned to the vulnerable 5.0.7 / 2.1.1. A plain npm update brace-expansion cleared it — no --force, no override.

fast-uri is the one real compromise. ajv pins fast-uri: ^3.0.1 and the fix is 4.x, so an overrides entry is the only route. It's documented in CLAUDE.md so it doesn't get "cleaned up" later.

Other bumps

vitest + @vitest/coverage-v8 4.1.9 → 5.0.0 — a major, but a non-event here: 85/85 tests, byte-identical coverage numbers, no config changes, no deprecation warnings. Plus routine ws 8.21.3, esbuild 0.28.2, happy-dom 20.14.0.

What was deliberately NOT bumped

typescript stays ^5.9.3, vite-plugin-dts stays ^4.5.4. TypeScript 7 removed the JavaScript Compiler API, and it fails two distinct ways:

  1. With vite-plugin-dts 4.5.4 → build fails outright (Cannot read properties of undefined (reading 'ESNext')).
  2. With vite-plugin-dts@5 + the @typescript/typescript6 bridge → build exits 0 but silently ships broken types. rollupTypes degrades to 14 multi-file stubs, dist/index.d.ts becomes a re-export stub, and attw reports Internal resolution error on all three entry points.

The second case is the dangerous one — a green build producing broken output. This confirms and sharpens the earlier July finding: the root cause is the TS 7 compiler-API removal, and the @typescript/typescript6 bridge does not rescue it.

vite-plugin-dts@5 would also not have helped the audit anyway — it moves @microsoft/api-extractor to a peer, and api-extractor 7.59.0 still pulls the same minimatch and tsdoc-config chains.

Verification

Each of these run on the final state:

  • npm audit → 0 vulnerabilities
  • npm ci --dry-run → clean (no @emnapi lockfile inconsistency this time)
  • npm run build → OK
  • ls dist/*.d.ts → exactly 3 files; find dist -name '*.d.ts' -mindepth 2 → 0 stubs
  • npm run test:ci → 85/85 passing, 9 files
  • attw --pack . → node16 (from ESM) green on all 3 entries — identical to the pre-change baseline

node10: Resolution failed on /browser and /vite is pre-existing baseline, not a regression from this PR.

Note on scope

CLAUDE.md's Test Patterns section said "26 tests across 3 files" — it's actually 85 across 9. Corrected here since the same file was already being edited for the dependency-constraint docs. Happy to split it out if you'd rather keep this PR purely dependencies.

🤖 Generated with Claude Code

Brings `npm audit` to 0 vulnerabilities (was 4 high, all dev-only and
never shipped — the published package's sole runtime dep is `ws`):

- vite 8.1.3 -> 8.2.2 clears postcss + nanoid
- brace-expansion refreshed in the lockfile. No version bump was needed:
  its parents already accepted the fixed 5.0.9/2.1.4, the lockfile was
  just pinned to the vulnerable 5.0.7/2.1.1
- overrides.fast-uri ^4.1.4 clears the last one. ajv pins fast-uri
  ^3.0.1, so the fixed 4.x only lands via an override

Also bumps vitest + @vitest/coverage-v8 to 5.0.0 (no code or config
changes needed), plus ws, esbuild and happy-dom.

typescript stays ^5.9.3 and vite-plugin-dts stays ^4.5.4. TypeScript 7
removed the JavaScript Compiler API: with dts 4.5.4 the build fails
outright, and with vite-plugin-dts@5 plus the @typescript/typescript6
bridge the build exits 0 while silently degrading rollupTypes to
multi-file stubs. Both constraints are now documented in CLAUDE.md.

Verified: npm audit 0 vulnerabilities, npm ci --dry-run clean, build OK,
3 rolled-up .d.ts with 0 stub files, 85/85 tests, attw node16-ESM green
on all 3 entry points.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kevinccbsg
kevinccbsg merged commit 2394bfb into main Sep 5, 2026
5 checks passed
@kevinccbsg
kevinccbsg deleted the chore/validate-dependency-updates branch September 5, 2026 20:34
kevinccbsg added a commit that referenced this pull request Sep 6, 2026
Minor, not patch: this release adds the failure-diagnostics block to
relay `test:fail` events (#15). Also carries the dependency bumps that
brought `npm audit` to zero (#14).

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant